import API from '../api'
import { commonUrl } from '../baseUrl'
import * as CommonApiMock from '../../mock/commonApiMock'

export const URL = {
  LOGIN: commonUrl('/v1/user/login'),
  USER_INFO: commonUrl('/v1/user/info'),
  MENU_LIST: commonUrl('/v1/user/menu')
}

// 登录
CommonApiMock.loginMock(URL.LOGIN)
export const login = async (params = {}, config = {}) => await API.post(URL.LOGIN, params, config)

// 用户信息
CommonApiMock.getUserInfoMock(URL.USER_INFO)
export const getUserInfo = async (params = {}, config = {}) => await API.post(URL.USER_INFO, params, config)

// 获取菜单和权限列表
CommonApiMock.getUserMenuMock(URL.MENU_LIST)
export const getUserMenu = async (params = {}, config = {}) => await API.post(URL.MENU_LIST, params, config)
